<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="订单编号" prop="orderNo">
        <el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="下单用户ID" prop="userId">
        <el-input v-model="queryParams.userId" placeholder="请输入下单用户ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="下单用户" prop="userName">
        <el-input v-model="queryParams.userName" placeholder="请输入下单用户姓名" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <!-- <el-form-item label="车辆ID" prop="carId">
        <el-input
          v-model="queryParams.carId"
          placeholder="请输入车辆ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车辆编号" prop="carNo">
        <el-input
          v-model="queryParams.carNo"
          placeholder="请输入车辆编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车辆数量 " prop="carQty">
        <el-input
          v-model="queryParams.carQty"
          placeholder="请输入车辆数量 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="addDriverQty">
        <el-input
          v-model="queryParams.addDriverQty"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="路基箱数量" prop="subgradeBoxQty">
        <el-input
          v-model="queryParams.subgradeBoxQty"
          placeholder="请输入路基箱数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="吊车吨位" prop="carWeight">
        <el-input
          v-model="queryParams.carWeight"
          placeholder="请输入吊车吨位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="机长数量" prop="captain">
        <el-input
          v-model="queryParams.captain"
          placeholder="请输入机长数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入场时间" prop="beginTime">
        <el-date-picker clearable
          v-model="queryParams.beginTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择入场时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束时间" prop="endTime">
        <el-date-picker clearable
          v-model="queryParams.endTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择结束时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="取车时间" prop="pickCarTime">
        <el-date-picker clearable
          v-model="queryParams.pickCarTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择取车时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="保险" prop="insurance">
        <el-input
          v-model="queryParams.insurance"
          placeholder="请输入保险"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="维护" prop="upkeep">
        <el-input
          v-model="queryParams.upkeep"
          placeholder="请输入维护"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工作时长" prop="workMonth">
        <el-input
          v-model="queryParams.workMonth"
          placeholder="请输入工作时长"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="地址ID" prop="workAddressId">
        <el-input
          v-model="queryParams.workAddressId"
          placeholder="请输入地址ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否有保证金 0：没有，1：有" prop="earnestMoneyFlag">
        <el-input
          v-model="queryParams.earnestMoneyFlag"
          placeholder="请输入是否有保证金 0：没有，1：有"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="保证金" prop="earnestMoney">
        <el-input
          v-model="queryParams.earnestMoney"
          placeholder="请输入保证金"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="折扣" prop="discount">
        <el-input
          v-model="queryParams.discount"
          placeholder="请输入折扣"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="税率" prop="rate">
        <el-input
          v-model="queryParams.rate"
          placeholder="请输入税率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="运输方式" prop="shipMode">
        <el-input
          v-model="queryParams.shipMode"
          placeholder="请输入运输方式"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="增配驾驶员" prop="addDriver">
        <el-input
          v-model="queryParams.addDriver"
          placeholder="请输入增配驾驶员"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="增配驾驶员金额" prop="addDriverPrice">
        <el-input
          v-model="queryParams.addDriverPrice"
          placeholder="请输入增配驾驶员金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="就餐" prop="eat">
        <el-input
          v-model="queryParams.eat"
          placeholder="请输入就餐"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="eatPrice">
        <el-input
          v-model="queryParams.eatPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="住宿" prop="sleep">
        <el-input
          v-model="queryParams.sleep"
          placeholder="请输入住宿"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="sleepPrice">
        <el-input
          v-model="queryParams.sleepPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="燃油" prop="oil">
        <el-input
          v-model="queryParams.oil"
          placeholder="请输入燃油"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="oilPrice">
        <el-input
          v-model="queryParams.oilPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="拆卸人工" prop="dismantlePerson">
        <el-input
          v-model="queryParams.dismantlePerson"
          placeholder="请输入拆卸人工"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="dismantlePersonPrice">
        <el-input
          v-model="queryParams.dismantlePersonPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="拆卸辅助吊车" prop="dismantleCar">
        <el-input
          v-model="queryParams.dismantleCar"
          placeholder="请输入拆卸辅助吊车"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="dismantleCarPrice">
        <el-input
          v-model="queryParams.dismantleCarPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="组装辅助吊车" prop="packageCar">
        <el-input
          v-model="queryParams.packageCar"
          placeholder="请输入组装辅助吊车"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="packgaCarPrice">
        <el-input
          v-model="queryParams.packgaCarPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="安装人工" prop="installPerson">
        <el-input
          v-model="queryParams.installPerson"
          placeholder="请输入安装人工"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="installPersonPrice">
        <el-input
          v-model="queryParams.installPersonPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="年检检测" prop="yearCheck">
        <el-input
          v-model="queryParams.yearCheck"
          placeholder="请输入年检检测"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="yearCheckPrice">
        <el-input
          v-model="queryParams.yearCheckPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="委托检测" prop="entrustCheck">
        <el-input
          v-model="queryParams.entrustCheck"
          placeholder="请输入委托检测"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="entrustCheckPrice">
        <el-input
          v-model="queryParams.entrustCheckPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="环保检测" prop="envCheck">
        <el-input
          v-model="queryParams.envCheck"
          placeholder="请输入环保检测"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="envCheckPrice">
        <el-input
          v-model="queryParams.envCheckPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="使用登记证" prop="certificate">
        <el-input
          v-model="queryParams.certificate"
          placeholder="请输入使用登记证"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="certificatePrice">
        <el-input
          v-model="queryParams.certificatePrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="体检" prop="medical">
        <el-input
          v-model="queryParams.medical"
          placeholder="请输入体检"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="medicalPrice">
        <el-input
          v-model="queryParams.medicalPrice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总金额" prop="totalPrice">
        <el-input
          v-model="queryParams.totalPrice"
          placeholder="请输入总金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="司机ID" prop="driverId">
        <el-input
          v-model="queryParams.driverId"
          placeholder="请输入司机ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="司机名称" prop="driverName">
        <el-input
          v-model="queryParams.driverName"
          placeholder="请输入司机名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同编号" prop="contractNo">
        <el-input
          v-model="queryParams.contractNo"
          placeholder="请输入合同编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="invoice">
        <el-input
          v-model="queryParams.invoice"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="订单状态" prop="orderState">
        <el-input
          v-model="queryParams.orderState"
          placeholder="请输入订单状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <!-- <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['system:order:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['system:order:edit']">修改</el-button>
      </el-col> -->
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['system:order:remove']">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['system:order:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange" @row-dblclick="dbclick">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="订单号" align="center" prop="orderNo" />
      <el-table-column label="下单用户姓名" align="center" prop="userName" />
      <el-table-column label="吊车吨位" align="center" prop="carWeight" />
      <el-table-column label="车辆数量 " align="center" prop="carQty" />
      <el-table-column label="入场时间" align="center" prop="beginTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.beginTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束时间" align="center" prop="endTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="施工月数" align="center" prop="workMonth" />
      <el-table-column label="保证金" align="center" prop="earnestMoney" />
      <el-table-column label="总费用" align="center" prop="totalPrice" />
      <el-table-column label="订单状态" align="center" prop="orderState" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="修改时间" align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>

      <!-- <el-table-column label="订单ID" align="center" prop="id" />
      <el-table-column label="下单用户ID" align="center" prop="userId" />
      <el-table-column label="车辆ID" align="center" prop="carId" />
      <el-table-column label="车辆编号" align="center" prop="carNo" />
      <el-table-column label="路基箱数量" align="center" prop="subgradeBoxQty" />
      <el-table-column label="机长数量" align="center" prop="captain" />
      <el-table-column label="施工方式" align="center" prop="chargeType" />
      <el-table-column label="取车时间" align="center" prop="pickCarTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.pickCarTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="付款方式 0：0天，30：30天，60：60天，90：90天" align="center" prop="payType" />
      <el-table-column label="保险" align="center" prop="insurance" />
      <el-table-column label="维护" align="center" prop="upkeep" />

      <el-table-column label="地址ID" align="center" prop="workAddressId" />
      <el-table-column label="地址" align="center" prop="workAddress" />
      <el-table-column label="施工场景" align="center" prop="workEnv" />
      <el-table-column label="工作内容" align="center" prop="workContent" />
      <el-table-column label="是否有保证金 0：没有，1：有" align="center" prop="earnestMoneyFlag" />

      <el-table-column label="折扣" align="center" prop="discount" />
      <el-table-column label="税率" align="center" prop="rate" />
      <el-table-column label="运输方式" align="center" prop="shipMode" />
      <el-table-column label="增配驾驶员" align="center" prop="addDriver" />
      <el-table-column label="增配驾驶员金额" align="center" prop="addDriverPrice" />
      <el-table-column label="就餐" align="center" prop="eat" />
      <el-table-column label="住宿" align="center" prop="sleep" />
      <el-table-column label="燃油" align="center" prop="oil" />
      <el-table-column label="拆卸人工" align="center" prop="dismantlePerson" />
      <el-table-column label="拆卸辅助吊车" align="center" prop="dismantleCar" />
      <el-table-column label="组装辅助吊车" align="center" prop="packageCar" />
      <el-table-column label="安装人工" align="center" prop="installPerson" />
      <el-table-column label="年检检测" align="center" prop="yearCheck" />
      <el-table-column label="委托检测" align="center" prop="entrustCheck" />
      <el-table-column label="环保检测" align="center" prop="envCheck" />
      <el-table-column label="使用登记证" align="center" prop="certificate" />
      <el-table-column label="体检" align="center" prop="medical" />

      <el-table-column label="司机ID" align="center" prop="driverId" />
      <el-table-column label="司机名称" align="center" prop="driverName" />
      <el-table-column label="合同编号" align="center" prop="contractNo" /> -->

      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['system:order:edit']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['system:order:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改订单列对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="订单号" prop="orderNo">
          <el-input v-model="form.orderNo" placeholder="请输入订单号" />
        </el-form-item>
        <el-form-item label="下单用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入下单用户ID" />
        </el-form-item>
        <el-form-item label="下单用户姓名" prop="userName">
          <el-input v-model="form.userName" placeholder="请输入下单用户姓名" />
        </el-form-item>
        <el-form-item label="车辆ID" prop="carId">
          <el-input v-model="form.carId" placeholder="请输入车辆ID" />
        </el-form-item>
        <el-form-item label="车辆编号" prop="carNo">
          <el-input v-model="form.carNo" placeholder="请输入车辆编号" />
        </el-form-item>
        <el-form-item label="车辆数量 " prop="carQty">
          <el-input v-model="form.carQty" placeholder="请输入车辆数量 " />
        </el-form-item>
        <el-form-item label="${comment}" prop="addDriverQty">
          <el-input v-model="form.addDriverQty" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="路基箱数量" prop="subgradeBoxQty">
          <el-input v-model="form.subgradeBoxQty" placeholder="请输入路基箱数量" />
        </el-form-item>
        <el-form-item label="吊车吨位" prop="carWeight">
          <el-input v-model="form.carWeight" placeholder="请输入吊车吨位" />
        </el-form-item>
        <el-form-item label="机长数量" prop="captain">
          <el-input v-model="form.captain" placeholder="请输入机长数量" />
        </el-form-item>
        <el-form-item label="入场时间" prop="beginTime">
          <el-date-picker clearable v-model="form.beginTime" type="date" value-format="yyyy-MM-dd"
            placeholder="请选择入场时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="endTime">
          <el-date-picker clearable v-model="form.endTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="取车时间" prop="pickCarTime">
          <el-date-picker clearable v-model="form.pickCarTime" type="date" value-format="yyyy-MM-dd"
            placeholder="请选择取车时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="保险" prop="insurance">
          <el-input v-model="form.insurance" placeholder="请输入保险" />
        </el-form-item>
        <el-form-item label="维护" prop="upkeep">
          <el-input v-model="form.upkeep" placeholder="请输入维护" />
        </el-form-item>
        <el-form-item label="工作时长" prop="workMonth">
          <el-input v-model="form.workMonth" placeholder="请输入工作时长" />
        </el-form-item>
        <el-form-item label="地址ID" prop="workAddressId">
          <el-input v-model="form.workAddressId" placeholder="请输入地址ID" />
        </el-form-item>
        <el-form-item label="地址" prop="workAddress">
          <el-input v-model="form.workAddress" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="施工场景" prop="workEnv">
          <el-input v-model="form.workEnv" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="工作内容">
          <editor v-model="form.workContent" :min-height="192" />
        </el-form-item>
        <el-form-item label="是否有保证金 0：没有，1：有" prop="earnestMoneyFlag">
          <el-input v-model="form.earnestMoneyFlag" placeholder="请输入是否有保证金 0：没有，1：有" />
        </el-form-item>
        <el-form-item label="保证金" prop="earnestMoney">
          <el-input v-model="form.earnestMoney" placeholder="请输入保证金" />
        </el-form-item>
        <el-form-item label="折扣" prop="discount">
          <el-input v-model="form.discount" placeholder="请输入折扣" />
        </el-form-item>
        <el-form-item label="税率" prop="rate">
          <el-input v-model="form.rate" placeholder="请输入税率" />
        </el-form-item>
        <el-form-item label="运输方式" prop="shipMode">
          <el-input v-model="form.shipMode" placeholder="请输入运输方式" />
        </el-form-item>
        <el-form-item label="增配驾驶员" prop="addDriver">
          <el-input v-model="form.addDriver" placeholder="请输入增配驾驶员" />
        </el-form-item>
        <el-form-item label="增配驾驶员金额" prop="addDriverPrice">
          <el-input v-model="form.addDriverPrice" placeholder="请输入增配驾驶员金额" />
        </el-form-item>
        <el-form-item label="就餐" prop="eat">
          <el-input v-model="form.eat" placeholder="请输入就餐" />
        </el-form-item>
        <el-form-item label="${comment}" prop="eatPrice">
          <el-input v-model="form.eatPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="住宿" prop="sleep">
          <el-input v-model="form.sleep" placeholder="请输入住宿" />
        </el-form-item>
        <el-form-item label="${comment}" prop="sleepPrice">
          <el-input v-model="form.sleepPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="燃油" prop="oil">
          <el-input v-model="form.oil" placeholder="请输入燃油" />
        </el-form-item>
        <el-form-item label="${comment}" prop="oilPrice">
          <el-input v-model="form.oilPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="拆卸人工" prop="dismantlePerson">
          <el-input v-model="form.dismantlePerson" placeholder="请输入拆卸人工" />
        </el-form-item>
        <el-form-item label="${comment}" prop="dismantlePersonPrice">
          <el-input v-model="form.dismantlePersonPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="拆卸辅助吊车" prop="dismantleCar">
          <el-input v-model="form.dismantleCar" placeholder="请输入拆卸辅助吊车" />
        </el-form-item>
        <el-form-item label="${comment}" prop="dismantleCarPrice">
          <el-input v-model="form.dismantleCarPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="组装辅助吊车" prop="packageCar">
          <el-input v-model="form.packageCar" placeholder="请输入组装辅助吊车" />
        </el-form-item>
        <el-form-item label="${comment}" prop="packgaCarPrice">
          <el-input v-model="form.packgaCarPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="安装人工" prop="installPerson">
          <el-input v-model="form.installPerson" placeholder="请输入安装人工" />
        </el-form-item>
        <el-form-item label="${comment}" prop="installPersonPrice">
          <el-input v-model="form.installPersonPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="年检检测" prop="yearCheck">
          <el-input v-model="form.yearCheck" placeholder="请输入年检检测" />
        </el-form-item>
        <el-form-item label="${comment}" prop="yearCheckPrice">
          <el-input v-model="form.yearCheckPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="委托检测" prop="entrustCheck">
          <el-input v-model="form.entrustCheck" placeholder="请输入委托检测" />
        </el-form-item>
        <el-form-item label="${comment}" prop="entrustCheckPrice">
          <el-input v-model="form.entrustCheckPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="环保检测" prop="envCheck">
          <el-input v-model="form.envCheck" placeholder="请输入环保检测" />
        </el-form-item>
        <el-form-item label="${comment}" prop="envCheckPrice">
          <el-input v-model="form.envCheckPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="使用登记证" prop="certificate">
          <el-input v-model="form.certificate" placeholder="请输入使用登记证" />
        </el-form-item>
        <el-form-item label="${comment}" prop="certificatePrice">
          <el-input v-model="form.certificatePrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="体检" prop="medical">
          <el-input v-model="form.medical" placeholder="请输入体检" />
        </el-form-item>
        <el-form-item label="${comment}" prop="medicalPrice">
          <el-input v-model="form.medicalPrice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="总金额" prop="totalPrice">
          <el-input v-model="form.totalPrice" placeholder="请输入总金额" />
        </el-form-item>
        <el-form-item label="司机ID" prop="driverId">
          <el-input v-model="form.driverId" placeholder="请输入司机ID" />
        </el-form-item>
        <el-form-item label="司机名称" prop="driverName">
          <el-input v-model="form.driverName" placeholder="请输入司机名称" />
        </el-form-item>
        <el-form-item label="合同编号" prop="contractNo">
          <el-input v-model="form.contractNo" placeholder="请输入合同编号" />
        </el-form-item>
        <el-form-item label="${comment}" prop="invoice">
          <el-input v-model="form.invoice" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="订单状态" prop="orderState">
          <el-input v-model="form.orderState" placeholder="请输入订单状态" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog title="订单详情" :visible.sync="detailOpen" width="1200px" height="1000px" append-to-body fullscreen>
      <el-row>
        <el-col :span="8">
          <div class="grid-content bg-purple"></div>
        </el-col>
        <el-col :span="8">
          <div class="grid-content bg-purple"></div>
        </el-col>
        <el-col :span="8">
          <!-- <el-card class="box-card"> -->
          <!-- <div slot="header" class="clearfix">
              <span>操作</span>
            </div> -->
          <el-button type="success">环保检测</el-button>
          <el-button type="primary">安装人工</el-button>
          <el-button type="success">拆车辅助吊车</el-button>
          <el-button type="primary">体检</el-button>
          <!-- </el-card> -->
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>订单</span>
            </div>
            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="8">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>租赁信息</span>
            </div>

            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>施工信息</span>
            </div>

            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>其他信息</span>
            </div>

            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>费用信息</span>
            </div>

            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>支付方式</span>
            </div>
            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>支付方式</span>
            </div>
            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>退款信息</span>
            </div>
            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>其他信息</span>
            </div>
            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>合同签署</span>
            </div>
            <div class="grid-content bg-purple-dark">1</div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="clearfix">
              <span>历史司机</span>
            </div>
            <div class="grid-content bg-purple-dark">
              <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"
                @row-dblclick="dbclick">
                <el-table-column type="selection" width="55" align="center" />
                <el-table-column label="ID" align="center" prop="id" />
                <el-table-column label="头像" align="center" prop="headImg" />
                <el-table-column label="部门ID" align="center" prop="deptId" />
                <el-table-column label="部门名称 " align="center" prop="deptName" />
                <el-table-column label="司机姓名" align="center" prop="driverName" />
                <el-table-column label="联系方式" align="center" prop="mobile" />
                <el-table-column label="空闲状态" align="center" prop="workState" />
                <el-table-column label="负责车辆数量" align="center" prop="carChargeQty" />
                <el-table-column label="派单记录数" align="center" prop="orderRecordQty" />
                <el-table-column label="工作天数" align="center" prop="workDay" />
                <el-table-column label="司机类型" align="center" prop="driverType" />
                <el-table-column label="最近工作时间" align="center" prop="lastWorkTime" width="180">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.lastWorkTime, '{y}-{m}-{d}') }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="创建时间" align="center" prop="createTime" width="180">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  </template>
                </el-table-column>

              </el-table>

            </div>
          </el-card>
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order";

export default {
  name: "Order",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 订单列表格数据
      orderList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,

      detailOpen: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        orderNo: null,
        userId: null,
        userName: null,
        carId: null,
        carNo: null,
        carQty: null,
        addDriverQty: null,
        subgradeBoxQty: null,
        carWeight: null,
        captain: null,
        chargeType: null,
        beginTime: null,
        endTime: null,
        pickCarTime: null,
        payType: null,
        insurance: null,
        upkeep: null,
        workMonth: null,
        workAddressId: null,
        workAddress: null,
        workEnv: null,
        workContent: null,
        earnestMoneyFlag: null,
        earnestMoney: null,
        discount: null,
        rate: null,
        shipMode: null,
        addDriver: null,
        addDriverPrice: null,
        eat: null,
        eatPrice: null,
        sleep: null,
        sleepPrice: null,
        oil: null,
        oilPrice: null,
        dismantlePerson: null,
        dismantlePersonPrice: null,
        dismantleCar: null,
        dismantleCarPrice: null,
        packageCar: null,
        packgaCarPrice: null,
        installPerson: null,
        installPersonPrice: null,
        yearCheck: null,
        yearCheckPrice: null,
        entrustCheck: null,
        entrustCheckPrice: null,
        envCheck: null,
        envCheckPrice: null,
        certificate: null,
        certificatePrice: null,
        medical: null,
        medicalPrice: null,
        totalPrice: null,
        driverId: null,
        driverName: null,
        contractNo: null,
        invoice: null,
        orderState: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询订单列列表 */
    getList() {
      this.loading = true;
      listOrder(this.queryParams).then(response => {
        this.orderList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        orderNo: null,
        userId: null,
        userName: null,
        carId: null,
        carNo: null,
        carQty: null,
        addDriverQty: null,
        subgradeBoxQty: null,
        carWeight: null,
        captain: null,
        chargeType: null,
        beginTime: null,
        endTime: null,
        pickCarTime: null,
        payType: null,
        insurance: null,
        upkeep: null,
        workMonth: null,
        workAddressId: null,
        workAddress: null,
        workEnv: null,
        workContent: null,
        earnestMoneyFlag: null,
        earnestMoney: null,
        discount: null,
        rate: null,
        shipMode: null,
        addDriver: null,
        addDriverPrice: null,
        eat: null,
        eatPrice: null,
        sleep: null,
        sleepPrice: null,
        oil: null,
        oilPrice: null,
        dismantlePerson: null,
        dismantlePersonPrice: null,
        dismantleCar: null,
        dismantleCarPrice: null,
        packageCar: null,
        packgaCarPrice: null,
        installPerson: null,
        installPersonPrice: null,
        yearCheck: null,
        yearCheckPrice: null,
        entrustCheck: null,
        entrustCheckPrice: null,
        envCheck: null,
        envCheckPrice: null,
        certificate: null,
        certificatePrice: null,
        medical: null,
        medicalPrice: null,
        totalPrice: null,
        driverId: null,
        driverName: null,
        contractNo: null,
        invoice: null,
        orderState: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加订单列";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getOrder(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改订单列";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateOrder(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addOrder(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除订单列编号为"' + ids + '"的数据项？').then(function () {
        return delOrder(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/order/export', {
        ...this.queryParams
      }, `order_${new Date().getTime()}.xlsx`)
    },

    dbclick(row) {
      console.log(row);
      this.detailOpen = true;
      const id = row.id || this.ids;
    }
  }
};
</script>

<style>
.el-row {
  margin-bottom: 5px;

  &:last-child {
    margin-bottom: 0;
  }

}

.bg-purple {
  background: #d3dce6;
}
</style>
